package com.fulihui.common.request.rpc;

import lombok.Getter;
import lombok.Setter;

/**
 * 分页基础接口
 *
 * @author: Levon
 * @version: v 0.1 2018-06-14 14:42
 */
@Getter
@Setter
public class PageRequest extends AbstractServiceRequest {

    private static final long serialVersionUID = 6279731314376722356L;
    protected int page = 1;
    protected int rows = 20;

    /**
     * 分页查询 limit 的起始值
     */
    public int start() {
        return page > 1 ? (page - 1) * rows : 0;
    }

}
